@import "lib/reset.scss";
@import "lib/rounded.scss";
@import "lib/shadow.scss";
@import "lib/headlines.scss";
@import "lib/patch.scss";
@import "lib/autocomplete.scss";
@import "constants.scss";
@import "layout.scss";
@import "menu.scss";

@include global-reset;

body {
  color: #111111;
  background: white;
  font-family: $normal_font;
  font-size: 10pt;
  line-height: 1.2em;
}

@mixin headline {
  font-family: $headline_font;
  color: $color1;
  margin: 1em 0 0.5em 0;
  line-height: 1.2em;
}

@include headlines;

h1 {
  margin-top: 0;
}

strong {
  font-weight: bold;
}

em {
  font-style: italic;
}

ul,ol,p {
  margin: 0.8em 0 0.8em 0;
}

ul,ol ul,ol {
  margin: 0;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

ul, ol {
  list-style-position: outside;
  padding-left: 1.5em;
}

ul.pagination {
  height: 3em;
}

ul.button-bar, ul.pagination {
  list-style-type: none;
  margin: 0;
  display: block;
  padding: 0;
  width: 100%;
  li {
    float: left;
    padding: 0;
    margin: 0;
    a, span {
      display: block;
      background: url(images/bg/button.png) repeat-x left bottom transparent;
      border: 1px solid $border_color;
      border-left: 0px none;
      color: $dark_color;
      padding: 0em 0.5em;
      line-height: 1.5em;
      &:active, &.current, &.loading {
        background: url(images/bg/button.png) repeat-x left bottom $light_bg1;
      }
      &.loading {
        background: $light_bg1 url(images/loading.gif) repeat;
      }
      &.ellipsis:before {
        content: '\22EF';
      }
      &.disabled {
        color: $border_color;
      }
    }
    &:first-child a, &:first-child span {
      border-left: 1px solid $border_color;
      @include rounded-left;
    }
    &:last-child a, &:last-child span {
      @include rounded-right;
    }
  }
}

dt {
  font-weight: bold;
  text-decoration: underline;
}

dd {
  margin: 0;
  padding: 0 0 0.5em 0;
}

table {
  border-collapse: separate;
  border-spacing: 0px;
  background: $border_color;
  padding: 1px;
  margin: 0 0 2em 0;
  td, th {
    border-top: 1px solid #E5E5E5;
    padding: 0.2em 0.5em;
    &.link {
      padding: 0;
      a {
        margin: 0;
        padding: 0.2em 0.5em;
        display: block;
      }
    }
  }
  tr {
    background: $main_bg;
    &:first-child td {
      border-top: 0px none;
    }
  }
  thead tr {
    background: url(images/bg/button.png) repeat-x left bottom $light_bg1;
    th {
      border-bottom: $border;
      border-top: 0px none;
    }
  }
}

a {
  &, &:visited {
    color: $color1;
    text-decoration: none;
  }
  &.img {
    background: transparent;
  }
}

span.img {
  border: $border;
  float: right;
  text-align: center;
  color: black;
  background: $main_bg;
  padding: 0.2em;
  img {
    display: block;
  }
}

.editsection {
  @include rounded;
  border: $border;
  display: block;
  background: url(images/bg/button.png) repeat-x left bottom #FFF;
  font-family: $normal_font;
  font-size: 9pt;
  line-height: 9pt;
  margin-top: 2px;
  padding: 2px;
  color: $dark_color;
  float: right;
  font-variant: normal;
  &:visited {
    color: $dark_color;
  }
}

sub {
  vertical-align: text-bottom;
  font-size: 75%;
}

sup {
  vertical-align: text-top;
  font-size: 75%;
}

img {
  vertical-align: middle;
}

hr {
  background: $border_color;
  border: none;
  height: 1px;
}

.version, tt, pre, code, kbd {
  font-family: $monospace_font;
}

pre {
  border: $border;
  padding: 0em 0.5em 1em 0.5em;
  min-width: 60%;
  white-space: pre-wrap;
  display: block;
}

#history .compare {
  padding: 0;
  width: 1em;
  button {
    margin: 1px;
    display: inline;
    font-size: small;
  }
  input {
    display: inline;
    margin: 0 3px;
  }
}

table.full, #history, #subpages {
  width: 100%;
  td, th {
    white-space: nowrap;
  }
}

@mixin action-icon($name) {
  .action-#{$name} {
    text-indent: -999px;
    background: url(images/actions/#{$name}.png) no-repeat top left;
    float: left;
    width: 16px;
    height: 16px;
    overflow: hidden;
  }
}

@mixin file-type($type) {
  .file-type-#{$type}:before {
    content: url(images/filetypes/#{$type}.png) "\00a0";
  }
}

#subpages {
  .actions {
    width: 80px;
    padding: 0px;
  }
  @include action-icon("edit");
  @include action-icon("history");
  @include action-icon("delete");
  @include action-icon("move");
  .page:before {
    content: url(images/page.png) "\00a0";
  }
  .folder:before {
    content: url(images/folder.png) "\00a0";
  }
  @include file-type("7z");
  @include file-type("bz2");
  @include file-type("doc");
  @include file-type("flac");
  @include file-type("gz");
  @include file-type("html");
  @include file-type("java");
  @include file-type("jpg");
  @include file-type("midi");
  @include file-type("mp3");
  @include file-type("ogg");
  @include file-type("pdf");
  @include file-type("php");
  @include file-type("png");
  @include file-type("ppt");
  @include file-type("psd");
  @include file-type("rar");
  @include file-type("rb");
  @include file-type("sh");
  @include file-type("tar");
  @include file-type("txt");
  @include file-type("wma");
  @include file-type("xls");
  @include file-type("zip");
}

.info {
  color: #333;
}

.warn {
  color: #a50;
}

.error {
  color: #a00;
}

.ref {
  vertical-align: super;
  font-size: 80%;
}

button {
  @include rounded;
  background: url(images/bg/button.png) repeat-x left bottom #FFF;
  float: left;
  margin: 0.3em 0.5em 0.3em 0;
  padding: 2px;
  border: 1px solid $border_color;
  color: $dark_color;
  white-space: nowrap;
  &:active:not([disabled]), &.loading {
    background: url(images/bg/button.png) repeat-x left bottom $light_bg1;
  }
  &.loading {
    background: url(images/loading.gif) repeat $light_bg1;
  }
  &[disabled] {
    color: #999;
  }
}

form {
  display: inline;
  select, textarea, input {
    float: left;
    margin: 0.3em 0.5em 0.3em 0;
    padding: 2px;
    border: $border;
    background: $main_bg;
    color: $dark_color;
    &:focus {
      border-style: dotted;
    }
  }
  label {
    float: left;
    margin: 0;
    padding: 0.4em 0.5em 0.4em 0;
    border: none;
    background: none;
    color: $dark_color;
    &.unsaved {
      font-style: italic;
    }
  }
  .fieldset label {
    width: 12em;
    text-align: right;
  }
  .indent {
    margin-left: 12.5em;
    label {
      width: auto;
    }
  }
  input[type=text], input[type=password] {
    font-family: $monospace_font;
    width: 20em;
  }
  select {
    width: 20em;
  }
  textarea {
    width: 100%;
    font-family: $monospace_font;
    font-size: 100%;
  }
  input {
    &[type=image], &[type=image]:focus, &[type=checkbox] {
      border: none;
      background: none;
    }
    &[type=hidden] {
      display: none;
    }
  }
  br {
    clear: left;
  }
}

.flash {
  margin: 0.5em 0;
  border: 1px solid #d33;
  list-style-type: none;
  padding: 0.5em;
  background: #fdd;
}

table input {
  margin: 0;
}

.box, .fieldset, .tab {
  @include rounded;
  @include box-shadow;
  clear: both;
  display: block;
  border: $border;
  padding: 0.5em 1em;
  margin: 1em 0;
  overflow: auto;
  h1, h2, h3, h4, h5, h6 {
    margin: 0.2em 0;
  }
}

.js {
  .tabs {
    @include list-bar;
    margin: 0 0 1px 0;
    height: 1.5em;
    width: 100%;
    z-index: 100;
    position: relative;
    > li {
      @include rounded-tl;
      @include rounded-tr;
      background: url(images/bg/button.png) repeat-x left bottom $light_bg1;
      float: left;
      padding: 0;
      margin: 0 4px 0 0;
      height: 1.5em;
      line-height: 1.5em;
      border: $border;
      &.selected > a {
        @include rounded-tl;
        @include rounded-tr;
        background: $main_bg;
        border-bottom: 1px solid white;
      }
      > a {
        display: block;
        text-decoration: none;
        white-space: nowrap;
        padding: 0 0.8em;
        color: $dark_color;
        &:hover, &:active, &:focus {
          text-shadow: #333333 1px 1px 2px;
        }
      }
    }
  }
  .tab {
    @include rounded-tl(0px);
  }
}

.no-js .tabs {
  display: none;
}

.hidden {
  display: none !important;
}

.toc {
  .toc1 {
    font-weight: bold;
    > ol {
      margin-bottom: 1em;
    }
    .toc2 {
      font-weight: normal;
    }
  }
}

a.absent {
  color: #A55;
}

.archive #header {
  background: $header_bg2;
}

.error_page {
  padding-left: 120px;
  min-height: 400px;
  background: url(images/bug.png) top left no-repeat;
}

.not_found_page {
  padding-left: 120px;
  min-height: 400px;
  background: url(images/not_found.png) top left no-repeat;
}

@import "iehacks.scss";
